<style>
.unit label{
	width:125px;
}
</style>
<div class="pageContent">
<form method="post" action="__URL__/goodsupdate/navTabId/__MODULE__/callbackType/closeCurrent" class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone1);">
	    <input type="hidden" name="userid" value="<?php echo $_SESSION[C('USER_AUTH_KEY')] ?>">
		<input type="hidden" name="id" value="{$vo.id}" >
		<div class="pageFormContent" layoutH="50">
			<div class="unit">
				<label>购买产品名称：</label>
				<input name="goodname" type="text" value="{$vo.goodname}"/>
			</div>
			
			<div class="unit">
				<label>产品单价/吨：</label>
				<input name="price" type="text" id="price"  value="{$vo.price}"/>
			</div>
			<div class="unit">
				<label>购买数量：</label> 
				<input type="text" name="quality"   id="quality" value="{$vo.quality}" onblur="setVal();" onkeydown="hideText();"/>
			</div>
			<div class="unit">
				<label>金额：</label>
				<input type="text" name="totalprice"  id="totalprice"  value="{$vo.totalprice}" onblur="setVal();"/>
			</div>
		</div>
		<script type="text/javascript">
			function setVal() {
				//var quality=document.getElementById('quality').value;
				var totalprice = document.getElementById('totalprice');
				var price = document.getElementById('price');
				var quality = document.getElementById('quality');
				//totalprice.value=quality*price;
				if(totalprice.value!=null&&totalprice.value!=""&&price.value!=null&&price.value!="")
				{
				  quality.value = totalprice.value / price.value;
				}
				else if(quality.value!=null&&quality.value!=""&&price.value!=null&&price.value!="")
				{
					totalprice.value=quality.value*price.value;
					
				}
			}
			function hideText()
			{
				document.getElementById('totalprice').value="";
			}
			</script>
		
		<div class="formBar">
			<ul>
				<!--<li><a class="buttonActive" href="javascript:;"><span>保存</span></a></li>-->
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">保存</button></div></div></li>
				<li>
					<div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div>
				</li>
			</ul>
		</div>
	</form>
	</div>